#!/usr/bin/env puppet
#
# Setup a demo machine

# Hint: export FACTER_DEMOSETUPDIR="$(pwd)"
$svn_workdir = "$demosetupdir/trunk"

# This is a totally blank manifest.
# set export FACTER_DEMOSOURCE="-dev" or "-complete"
$setup_source = "master$demosource"

File {
  owner => 0,
  group => 0,
  mode => 0666,
  ignore => [ ".svn" ],
  backup => false
}

file {
  "/usr/lib/ruby/site_ruby/1.8/puppet/provider/package/pkgdmg.rb":
    source => "$svn_workdir/hotfixes/pkgdmg.rb",
    mode => 0644;
  "/usr/lib/ruby/site_ruby/1.8/puppet/util.rb":
    source => "$svn_workdir/hotfixes/util.rb",
    mode => 0644;
  "/etc/puppet":
    ensure => directory;
  "/etc/puppet/puppet.conf":
    source => "$svn_workdir/etc/puppet/puppet.conf";
  "/etc/puppet/fileserver.conf":
    source => "$svn_workdir/etc/puppet/fileserver.conf";
  "/etc/puppet/manifests":
    source => "$svn_workdir/puppet/$setup_source/manifests",
    recurse => true;
  "/etc/puppet/dist":
    source => "$svn_workdir/puppet/dist",
    recurse => true;
  "/etc/motd":
    ensure => absent;
  "/var/puppet":
    ensure => directory;
  "/var/puppet/facts":
    ensure => directory;
  "/Library/Application Support/TextMate":
    ensure => directory;
  "/Library/Application Support/TextMate/Bundles":
    ensure => directory;
  "/Library/Application Support/TextMate/Bundles/_PuppetMacWorld2008.tmbundle":
    ensure => "$svn_workdir/textmate_bundle_two/_PuppetMacWorld2008.tmbundle";
  "/Library/WebServer/Documents/packages":
    source => "$svn_workdir/packages",
    recurse => true;
  "/Applications/Firefox.app":
    ensure => absent,
    force => true;
  "/var/db/.puppet_pkgdmg_installed_Firefox-2.0.0.7-1.pkg.dmg":
    ensure => absent;
  "/var/db/shadow/hash/ECA08D4A-BD76-459F-B2FB-C6AA24D75B7E":
    ensure => absent;
  "/var/db/dslocal/nodes/Default/users/clientadmin.plist":
    ensure => absent;
}
